/**
 *
 */
import Util;
import OSS;
import OpenPlatform;
import OSSUtil;
import FileForm;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('cloudauth', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CompareFacesRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  sourceImageBase64?: string(name='SourceImageBase64'),
  sourceImageUrl?: string(name='SourceImageUrl'),
  targetImageBase64?: string(name='TargetImageBase64'),
  targetImageUrl?: string(name='TargetImageUrl'),
}

model CompareFacesResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    confidenceThresholds?: string(name='ConfidenceThresholds'),
    similarityScore?: float(name='SimilarityScore'),
  }(name='ResultObject'),
  success?: boolean(name='Success'),
}

model CompareFacesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CompareFacesResponseBody(name='body'),
}

async function compareFacesWithOptions(request: CompareFacesRequest, runtime: Util.RuntimeOptions): CompareFacesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizId)) {
    body['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    body['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.sourceImageBase64)) {
    body['SourceImageBase64'] = request.sourceImageBase64;
  }
  if (!Util.isUnset(request.sourceImageUrl)) {
    body['SourceImageUrl'] = request.sourceImageUrl;
  }
  if (!Util.isUnset(request.targetImageBase64)) {
    body['TargetImageBase64'] = request.targetImageBase64;
  }
  if (!Util.isUnset(request.targetImageUrl)) {
    body['TargetImageUrl'] = request.targetImageUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CompareFaces',
    version = '2020-11-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function compareFaces(request: CompareFacesRequest): CompareFacesResponse {
  var runtime = new Util.RuntimeOptions{};
  return compareFacesWithOptions(request, runtime);
}

model DescribeVerifyResultRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
}

model DescribeVerifyResultResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    authorityComparisionScore?: float(name='AuthorityComparisionScore'),
    faceComparisonScore?: float(name='FaceComparisonScore'),
    idCardFaceComparisonScore?: float(name='IdCardFaceComparisonScore'),
    material?: {
      faceGlobalUrl?: string(name='FaceGlobalUrl'),
      faceImageUrl?: string(name='FaceImageUrl'),
      faceMask?: boolean(name='FaceMask'),
      faceQuality?: string(name='FaceQuality'),
      idCardInfo?: {
        address?: string(name='Address'),
        authority?: string(name='Authority'),
        backImageUrl?: string(name='BackImageUrl'),
        birth?: string(name='Birth'),
        endDate?: string(name='EndDate'),
        frontImageUrl?: string(name='FrontImageUrl'),
        name?: string(name='Name'),
        nationality?: string(name='Nationality'),
        number?: string(name='Number'),
        startDate?: string(name='StartDate'),
      }(name='IdCardInfo'),
      idCardName?: string(name='IdCardName'),
      idCardNumber?: string(name='IdCardNumber'),
      videoUrls?: [ string ](name='VideoUrls'),
    }(name='Material'),
    verifyStatus?: int32(name='VerifyStatus'),
  }(name='ResultObject'),
  success?: boolean(name='Success'),
}

model DescribeVerifyResultResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeVerifyResultResponseBody(name='body'),
}

async function describeVerifyResultWithOptions(request: DescribeVerifyResultRequest, runtime: Util.RuntimeOptions): DescribeVerifyResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVerifyResult',
    version = '2020-11-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeVerifyResult(request: DescribeVerifyResultRequest): DescribeVerifyResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVerifyResultWithOptions(request, runtime);
}

model DescribeVerifyTokenRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  faceRetainedImageUrl?: string(name='FaceRetainedImageUrl'),
  idCardBackImageUrl?: string(name='IdCardBackImageUrl'),
  idCardFrontImageUrl?: string(name='IdCardFrontImageUrl'),
  idCardNumber?: string(name='IdCardNumber'),
  name?: string(name='Name'),
  userId?: string(name='UserId'),
  userIp?: string(name='UserIp'),
  userPhoneNumber?: string(name='UserPhoneNumber'),
  userRegistTime?: long(name='UserRegistTime'),
}

model DescribeVerifyTokenResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    verifyPageUrl?: string(name='VerifyPageUrl'),
    verifyToken?: string(name='VerifyToken'),
  }(name='ResultObject'),
  success?: boolean(name='Success'),
}

model DescribeVerifyTokenResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeVerifyTokenResponseBody(name='body'),
}

async function describeVerifyTokenWithOptions(request: DescribeVerifyTokenRequest, runtime: Util.RuntimeOptions): DescribeVerifyTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.faceRetainedImageUrl)) {
    query['FaceRetainedImageUrl'] = request.faceRetainedImageUrl;
  }
  if (!Util.isUnset(request.idCardBackImageUrl)) {
    query['IdCardBackImageUrl'] = request.idCardBackImageUrl;
  }
  if (!Util.isUnset(request.idCardFrontImageUrl)) {
    query['IdCardFrontImageUrl'] = request.idCardFrontImageUrl;
  }
  if (!Util.isUnset(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.userIp)) {
    query['UserIp'] = request.userIp;
  }
  if (!Util.isUnset(request.userPhoneNumber)) {
    query['UserPhoneNumber'] = request.userPhoneNumber;
  }
  if (!Util.isUnset(request.userRegistTime)) {
    query['UserRegistTime'] = request.userRegistTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVerifyToken',
    version = '2020-11-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeVerifyToken(request: DescribeVerifyTokenRequest): DescribeVerifyTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVerifyTokenWithOptions(request, runtime);
}

model DetectFaceAttributesRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  imageFile?: string(name='ImageFile'),
  imageUrl?: string(name='ImageUrl'),
}

model DetectFaceAttributesAdvanceRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  imageFileObject?: readable(name='ImageFile'),
  imageUrl?: string(name='ImageUrl'),
}

model DetectFaceAttributesResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    faceInfos?: {
      faceAttributesDetectInfo?: [ 
      {
        faceAttributes?: {
          blur?: float(name='Blur'),
          facequal?: float(name='Facequal'),
          facetype?: string(name='Facetype'),
          glasses?: string(name='Glasses'),
          headpose?: {
            pitchAngle?: float(name='PitchAngle'),
            rollAngle?: float(name='RollAngle'),
            yawAngle?: float(name='YawAngle'),
          }(name='Headpose'),
          integrity?: int32(name='Integrity'),
          respirator?: string(name='Respirator'),
          smiling?: {
            threshold?: float(name='Threshold'),
            value?: float(name='Value'),
          }(name='Smiling'),
        }(name='FaceAttributes'),
        faceRect?: {
          height?: int32(name='Height'),
          left?: int32(name='Left'),
          top?: int32(name='Top'),
          width?: int32(name='Width'),
        }(name='FaceRect'),
      }
    ](name='FaceAttributesDetectInfo')
    }(name='FaceInfos'),
    imgHeight?: int32(name='ImgHeight'),
    imgWidth?: int32(name='ImgWidth'),
  }(name='ResultObject'),
  success?: boolean(name='Success'),
}

model DetectFaceAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DetectFaceAttributesResponseBody(name='body'),
}

async function detectFaceAttributesWithOptions(request: DetectFaceAttributesRequest, runtime: Util.RuntimeOptions): DetectFaceAttributesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizId)) {
    body['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    body['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.imageFile)) {
    body['ImageFile'] = request.imageFile;
  }
  if (!Util.isUnset(request.imageUrl)) {
    body['ImageUrl'] = request.imageUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DetectFaceAttributes',
    version = '2020-11-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function detectFaceAttributes(request: DetectFaceAttributesRequest): DetectFaceAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return detectFaceAttributesWithOptions(request, runtime);
}

async function detectFaceAttributesAdvance(request: DetectFaceAttributesAdvanceRequest, runtime: Util.RuntimeOptions): DetectFaceAttributesResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'Cloudauth',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var detectFaceAttributesReq = new DetectFaceAttributesRequest{};
  OpenApiUtil.convert(request, detectFaceAttributesReq);

  if(!Util.isUnset(request.imageFileObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.imageFileObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    detectFaceAttributesReq.imageFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var detectFaceAttributesResp = detectFaceAttributesWithOptions(detectFaceAttributesReq, runtime);
  return detectFaceAttributesResp;
}

model LivenessDetectRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  mediaCategory?: string(name='MediaCategory'),
  mediaFile?: string(name='MediaFile'),
  mediaUrl?: string(name='MediaUrl'),
}

model LivenessDetectAdvanceRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  mediaCategory?: string(name='MediaCategory'),
  mediaFileObject?: readable(name='MediaFile'),
  mediaUrl?: string(name='MediaUrl'),
}

model LivenessDetectResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    frameUrl?: string(name='FrameUrl'),
    passed?: string(name='Passed'),
    score?: float(name='Score'),
  }(name='ResultObject'),
  success?: boolean(name='Success'),
}

model LivenessDetectResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: LivenessDetectResponseBody(name='body'),
}

async function livenessDetectWithOptions(request: LivenessDetectRequest, runtime: Util.RuntimeOptions): LivenessDetectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizId)) {
    body['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    body['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.mediaCategory)) {
    body['MediaCategory'] = request.mediaCategory;
  }
  if (!Util.isUnset(request.mediaFile)) {
    body['MediaFile'] = request.mediaFile;
  }
  if (!Util.isUnset(request.mediaUrl)) {
    body['MediaUrl'] = request.mediaUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'LivenessDetect',
    version = '2020-11-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function livenessDetect(request: LivenessDetectRequest): LivenessDetectResponse {
  var runtime = new Util.RuntimeOptions{};
  return livenessDetectWithOptions(request, runtime);
}

async function livenessDetectAdvance(request: LivenessDetectAdvanceRequest, runtime: Util.RuntimeOptions): LivenessDetectResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if(Util.isUnset(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if(Util.isUnset(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApi.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'Cloudauth',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = null;

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var livenessDetectReq = new LivenessDetectRequest{};
  OpenApiUtil.convert(request, livenessDetectReq);

  if(!Util.isUnset(request.mediaFileObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.mediaFileObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    livenessDetectReq.mediaFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var livenessDetectResp = livenessDetectWithOptions(livenessDetectReq, runtime);
  return livenessDetectResp;
}

model VerifyMaterialRequest {
  bizId?: string(name='BizId'),
  bizType?: string(name='BizType'),
  faceImageUrl?: string(name='FaceImageUrl'),
  idCardBackImageUrl?: string(name='IdCardBackImageUrl'),
  idCardFrontImageUrl?: string(name='IdCardFrontImageUrl'),
  idCardNumber?: string(name='IdCardNumber'),
  name?: string(name='Name'),
  userId?: string(name='UserId'),
}

model VerifyMaterialResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    authorityComparisionScore?: float(name='AuthorityComparisionScore'),
    idCardFaceComparisonScore?: float(name='IdCardFaceComparisonScore'),
    material?: {
      faceGlobalUrl?: string(name='FaceGlobalUrl'),
      faceImageUrl?: string(name='FaceImageUrl'),
      faceMask?: string(name='FaceMask'),
      faceQuality?: string(name='FaceQuality'),
      idCardInfo?: {
        address?: string(name='Address'),
        authority?: string(name='Authority'),
        backImageUrl?: string(name='BackImageUrl'),
        birth?: string(name='Birth'),
        endDate?: string(name='EndDate'),
        frontImageUrl?: string(name='FrontImageUrl'),
        name?: string(name='Name'),
        nationality?: string(name='Nationality'),
        number?: string(name='Number'),
        startDate?: string(name='StartDate'),
      }(name='IdCardInfo'),
      idCardName?: string(name='IdCardName'),
      idCardNumber?: string(name='IdCardNumber'),
    }(name='Material'),
    verifyStatus?: int32(name='VerifyStatus'),
    verifyToken?: string(name='VerifyToken'),
  }(name='ResultObject'),
  success?: boolean(name='Success'),
}

model VerifyMaterialResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VerifyMaterialResponseBody(name='body'),
}

async function verifyMaterialWithOptions(request: VerifyMaterialRequest, runtime: Util.RuntimeOptions): VerifyMaterialResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.faceImageUrl)) {
    query['FaceImageUrl'] = request.faceImageUrl;
  }
  if (!Util.isUnset(request.idCardBackImageUrl)) {
    query['IdCardBackImageUrl'] = request.idCardBackImageUrl;
  }
  if (!Util.isUnset(request.idCardFrontImageUrl)) {
    query['IdCardFrontImageUrl'] = request.idCardFrontImageUrl;
  }
  if (!Util.isUnset(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyMaterial',
    version = '2020-11-12',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyMaterial(request: VerifyMaterialRequest): VerifyMaterialResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyMaterialWithOptions(request, runtime);
}

